package com.web.music.interfaces;

import java.util.List;

import com.web.music.model.PersistentObject;
import com.web.music.model.Track;

/**
 * Interface for general operations with persistent objects
 */
public interface PersistenceHelper {
	
	public void save(PersistentObject object);
	
	public void saveAll(List<? extends PersistentObject> objects);
	
	public PersistentObject getById(Class<? extends PersistentObject> clazz, Long id);
	
	public List<PersistentObject> findAll(Class<? extends PersistentObject> clazz);
	
	public void delete(PersistentObject object);
	
	public List<Track> findTracksByName(String s);
	
    public List<Track> findTracksByArtistId(long id);
    
    public List<Track> findTracksByPersonId(long id);

	
	/**
	 * Deletes all objects from database
	 */
	public void deleteEverything();
}
